// 搜索框
// ------------------------------------------------------------------------
var search = document.querySelector("input")
var lable = document.querySelector('label')
var body = document.body

lable.onclick = function () {
    lable.style.display = "none"
    search.focus()
    search.className = "seachange"
}
search.onblur = function () {
    if (search.value === "") {
        lable.style.display = "block"
    }
}
// ------------------------------------------------------------------------------
// 歌单数据渲染
let musicList = document.querySelectorAll('ol')
myaxios({
    url: 'http://localhost:8080/index'
}).then(result => {
    for (let j = 0; j < musicList.length; j++) {
        for (let i = 0; i < result.length; i++) {
            let li = document.createElement('li')
            let span = document.createElement('span')
            let a = document.createElement('a')
            a.style.marginLeft = '6px'
            a.href = '#'
            span.innerHTML = result[i].id
            a.innerHTML = result[i].musicName
            li.appendChild(span)
            li.appendChild(a)
            musicList[j].appendChild(li)
        }
    }

})